package com.yjd.comm.borrow.service;

import java.util.List;
import java.util.Map;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.borrow.model.ArrearsFormModel;
import com.yjd.comm.system.dto.OperParamDto;

/**
 * <b>description</b>：借款回款报表业务接口<br>
 * <b>time</b>：2014-11-17 11:03:48 <br>
 * <b>author</b>： ready likun_557@163.com
 */
public interface IArrearsFormService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ArrearsFormModel insert(ArrearsFormModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(ArrearsFormModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long id) throws Exception;

	/**
	 * 根据标的id获取标的回款报表
	 * 
	 * @param borrow_id
	 * @return
	 * @throws Exception
	 */
	public List<ArrearsFormModel> getArrearsFormModelsByBorrowId(Long borrow_id) throws Exception;

	/**
	 * 批量插入借款回款报表
	 * 
	 * @param list
	 * @throws Exception
	 */
	public void inserts(List<ArrearsFormModel> list) throws Exception;

	/**
	 * 根据map来更新数据
	 * 
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	public int updateByMap(Map param) throws Exception;

	public Double getFundsSum(int code, List<Long> userList, boolean b) throws Exception;
	
	/**
	 * 减免还款费用
	 * @param aid
	 * @param price
	 * @throws Exception
	 */
	public void reduction_price(Long aid,double price, OperParamDto operParamDto) throws Exception;

}
